package com.trinity.oldsystem.service.impl;

import com.trinity.common.utils.DateUtils;
import com.trinity.oldsystem.domain.DhxhBooklist;
import com.trinity.oldsystem.mapper.DhxhBooklistMapper;
import com.trinity.oldsystem.service.IDhxhBooklistService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 老系统数目清单Service业务层处理
 *
 * @author old-system
 * @date 2024-01-30
 */
@Service
public class DhxhBooklistServiceImpl implements IDhxhBooklistService {
    @Autowired
    private DhxhBooklistMapper dhxhBooklistMapper;

    /**
     * 查询老系统数目清单
     *
     * @param id 老系统数目清单主键
     * @return 老系统数目清单
     */
    @Override
    public DhxhBooklist selectDhxhBooklistById(String id) {
        return dhxhBooklistMapper.selectDhxhBooklistById(id);
    }

    /**
     * 查询老系统数目清单列表
     *
     * @param dhxhBooklist 老系统数目清单
     * @return 老系统数目清单
     */
    @Override
    public List<DhxhBooklist> selectDhxhBooklistList(DhxhBooklist dhxhBooklist) {
        return dhxhBooklistMapper.selectDhxhBooklistList(dhxhBooklist);
    }

    /**
     * 新增老系统数目清单
     *
     * @param dhxhBooklist 老系统数目清单
     * @return 结果
     */
    @Override
    public int insertDhxhBooklist(DhxhBooklist dhxhBooklist) {
        dhxhBooklist.setCreateTime(DateUtils.getNowDate());
        return dhxhBooklistMapper.insertDhxhBooklist(dhxhBooklist);
    }

    /**
     * 修改老系统数目清单
     *
     * @param dhxhBooklist 老系统数目清单
     * @return 结果
     */
    @Override
    public int updateDhxhBooklist(DhxhBooklist dhxhBooklist) {
        dhxhBooklist.setUpdateTime(DateUtils.getNowDate());
        return dhxhBooklistMapper.updateDhxhBooklist(dhxhBooklist);
    }

    /**
     * 批量删除老系统数目清单
     *
     * @param ids 需要删除的老系统数目清单主键
     * @return 结果
     */
    @Override
    public int deleteDhxhBooklistByIds(String[] ids) {
        return dhxhBooklistMapper.deleteDhxhBooklistByIds(ids);
    }

    /**
     * 删除老系统数目清单信息
     *
     * @param id 老系统数目清单主键
     * @return 结果
     */
    @Override
    public int deleteDhxhBooklistById(String id) {
        return dhxhBooklistMapper.deleteDhxhBooklistById(id);
    }
}
